package com.macro.mall.tiny.modules.bms.controller;

import com.macro.mall.tiny.common.api.CommonResult;
import com.macro.mall.tiny.modules.bms.dto.StatisticsResult;
import com.macro.mall.tiny.modules.bms.service.StatisticsService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@Tag(name = "AnalysisController", description = "统计分析服务")
@RestController
@RequestMapping("/analysis")
public class AnalysisController {
    
    @Autowired
    private StatisticsService statisticsService;
    
    @Operation(summary = "获取统计信息")
    @RequestMapping(value = "/statistics", method = RequestMethod.GET)
    @ResponseBody
    public CommonResult<StatisticsResult> getStatistics() {
        StatisticsResult statistics = statisticsService.getStatistics();
        return CommonResult.success(statistics);
    }
}